    var app = new Vue({
        el: ".deposit_wrap",
        data(){
            return {
                depositAddress:'', //充值地址
                depositAddress0:'0x8E7FE6dB2b28B56fD9663094495452aF4eE50f6F',
                showaddress: '',
                theuser: '',
                information: '',
                informationn: '',
                HPS: 'HPS',
                ETH: 'ETH',
                BTC: 'BTC',
                HSR: 'HSR' ,
                HAND: 'HAND',
                HART: 'HART', 
                MOT: 'MOT',
            }
        },
        mounted(){
            let lang = this.getCookie("lang");
            let _this=this;
            // document.getElementsByClassName('maskLayerr')[0].style.display="none"
            // document.getElementsByClassName('errorMessagee')[0].style.display="none"
            // document.getElementsByClassName('errorMessage')[0].style.display="none"
            var test = window.location.href;
            let index = test.substring(test.indexOf("id") + 3, test.indexOf("&"));
            let coin = test.substring(test.indexOf("name") + 5);
            this.showaddress = coin;
            this.depositChage(index,coin)
        },
        methods: {
            getCookie(cookiename) {
                //获取cookie
                var arr,
                  reg = new RegExp("(^| )" + cookiename + "=([^;]*)(;|$)");
                if ((arr = document.cookie.match(reg))) {
                  return unescape(arr[2]);
                } else {
                  return null;
                }
              },
            closeinfoo(){
                document.getElementsByClassName('maskLayerr')[0].style.display="none"
                document.getElementsByClassName('errorMessagee')[0].style.display="none"
                this.theuser="";
                this.information=""
                let BODY =document.getElementsByTagName("body")[0]
                BODY.style.overflowY=""
             },
             Promptpopup(){
                let lang = this.getCookie("lang");
                document.getElementsByClassName('errorMessagee')[0].style.display="block"
                document.getElementsByClassName('maskLayerr')[0].style.display="block"
                if (lang == "en_US") {
                    this.theuser="respected user"
                    this.informationn="As the reload wallet is undergoing upgrade and expansion, each recharge is currently subject to manual review. Please contact online customer service after recharge to provide user ID, transaction hash, we will review for you as soon as possible. Please be forgiven for inconvenience."
                } else if (lang == "zh_TW") {
                    this.theuser="尊敬的用戶"
                    this.informationn="因充值錢包正在進行升級擴容，目前每筆充值都需進行人工審核。請您充值後聯繫在線客服，提供用戶ID、交易哈希值，我們將盡快為你審核。帶來不便敬請諒解。"
                } else {
                    this.theuser="尊敬的用户"
                    this.informationn="因充值钱包正在进行升级扩容，目前每笔充值都需进行人工审核。请您充值后联系在线客服，提供用户ID、交易哈希值，我们将尽快为你审核。带来不便敬请谅解。"
                }
             },
            depositChage(index = null, coin = null) {
                this.depositAddress0 = "0x8E7FE6dB2b28B56fD9663094495452aF4eE50f6F";
                this.depositAddress = "";
                let userid = window.localStorage.getItem('ID')
                jQuery("#qrcode" + coin).empty();
                if(document.getElementsByTagName('canvas')[0]){
                  $("canvas").empty()
                }
                let params = {
                  coin: coin
                };
                axios.post("/adress/coin/depositAddress", params).then(res => {
                  this.depositAddress = res.data.data;
                  // if(userid==1007){
                    this.depositAddress0=this.depositAddress
                  // }
                if (coin===this.HPS) {
                    // this.Promptpopup()
                  jQuery("#qrcode" + coin).qrcode({
                    width: 162,
                    height: 162,
                    text: this.depositAddress
                  });
                }else if (coin===this.ETH) {
                    // this.Promptpopup()
                  jQuery("#qrcode" + coin).qrcode({
                    width: 162,
                    height: 162,
                    text: this.depositAddress
                  });
                }else if (coin===this.BTC) {
                  jQuery("#qrcode" + coin).qrcode({
                    width: 162,
                    height: 162,
                    text: this.depositAddress
                  });
                }else if (coin===this.HSR) {
                  jQuery("#qrcode" + coin).qrcode({
                    width: 162,
                    height: 162,
                    text: this.depositAddress
                  });
                }else if (coin===this.HAND) {
                    // this.Promptpopup()
                  jQuery("#qrcode" + coin).qrcode({
                    width: 162,
                    height: 162,
                    text: this.depositAddress
                  });
                }else if (coin===this.HART) {
                  // this.Promptpopup()
                jQuery("#qrcode" + coin).qrcode({
                  width: 162,
                  height: 162,
                  text: this.depositAddress0
                });
                }else if (coin===this.MOT) {
                  // this.Promptpopup()
                jQuery("#qrcode" + coin).qrcode({
                  width: 162,
                  height: 162,
                  text: this.depositAddress
                });
                }else {
                  jQuery("#qrcode" + coin).empty();
                }
              });

                
                // jQuery("#qrcode"+coin).empty();
                // if(document.getElementsByTagName('canvas')[0]){
                //     $("canvas").empty()
                // }
                // let params = {
                //     coin: coin
                // };
                // axios.post("/adress/coin/depositAddress", params).then(res => {
                //     this.depositAddress = res.data.data;
                //     if (res.data.data) {
                //         jQuery("#qrcode"+coin).qrcode({
                //             width: 162,
                //             height: 162,
                //             text: this.depositAddress
                //         });
                //     } else {
                //         jQuery("#qrcode"+coin).empty();
                //         jQuery("#qrcode"+coin)[0].style.display=""
                //     }
                // });
            },
            closeinfo(coin){
                let timer=setInterval(() => {
                    document.getElementsByClassName('errorMessage')[0].className='errorMessage'
                    clearInterval(timer)
                    timer=null
                },2000)
                document.getElementsByClassName('errorMessage')[0].className='errorMessage fadeInUp'
                this.theuser="";
                this.information=""
                let BODY =document.getElementsByTagName("body")[0]
                BODY.style.overflowY=""
            },
            onCopy(coin){ //复制充值地址
              let lang = this.getCookie("lang");
                if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { //区分iPhone设备  
                    // window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                    // var Url2 = document.getElementById("biaoios"+coin); //要复制文字的节点  
                    if(coin==this.HPS){
                      window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                      var Url2 = document.getElementById("biaoiosHPS");
                    }else if(coin==this.ETH){
                      window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                      var Url2 = document.getElementById("biaoiosETH");
                    }else if(coin==this.BTC){
                      window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                      var Url2 = document.getElementById("biaoiosBTC");
                    }else if(coin==this.HSR){
                      window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                      var Url2 = document.getElementById("biaoiosHSR");
                    }else if(coin==this.HAND){
                      window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                      var Url2 = document.getElementById("biaoiosHAND");
                    }else if(coin==this.HART){
                    window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                    var Url2 = document.getElementById("biaoiosHART");
                   }else if(coin==this.MOT){
                    window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
                    var Url2 = document.getElementById("biaoiosMOT");
                  }
                    var range = document.createRange();
                    // 选中需要复制的节点  
                    range.selectNode(Url2);
                    // 执行选中元素  
                    window.getSelection().addRange(range);
                    // 执行 copy 操作  
                    var successful = document.execCommand('Copy');
                    // 移除选中的元素  
                    window.getSelection().removeAllRanges();
                    // document.getElementsByClassName("copysuccess")[0].style.opacity=1
                    // document.getElementsByClassName("copysuccess")[0].style.transform="translate(-50%,-110%)"
                    // setInterval(function(){
                    //     document.getElementsByClassName("copysuccess")[0].style.opacity=0
                    // },2000)
                  } else {
                    if(coin==this.HPS){
                      var Url2 = this.depositAddress
                    }else if(coin==this.ETH){
                      var Url2 = this.depositAddress
                    }else if(coin==this.BTC){
                      var Url2 = this.depositAddress
                    }else if(coin==this.HSR){
                      var Url2 = this.depositAddress
                    }else if(coin==this.HAND){
                      var Url2 = this.depositAddress
                    }else if(coin==this.HART){
                      var Url2 = this.depositAddress
                    }else if(coin==this.MOT){
                      var Url2 = this.depositAddress
                    }
                    // var Url2 = this.depositAddress
                    var input = $('.input')
                    input.html(Url2)
                    input.select();
                    document.execCommand("Copy");
                  }
                  let timer=setInterval(() => {
                       document.getElementsByClassName('errorMessage')[0].className='errorMessage'
                       clearInterval(timer)
                       timer=null
                   },2000)
                   document.getElementsByClassName('errorMessage')[0].className='errorMessage fadeInUp'
                   if (lang == "en_US") {
                       this.information = "Successfully copied"
                   } else if (lang == "zh_TW") {
                       this.information = "複製成功"
                   } else {
                       this.information = "复制成功"
                   }
                  return 

            }
        }
    })